<template>
    <!-- <div class="page add-member">
        <div class="top-tip">通过以下方式邀请成员至<em>{{groupName | strEllipsis}}</em>小组</div>
        <ul class="user-list section">
            <li class="mod-user com-border-bottom">
                <a @click="toQrCode">
                    <span class="bg_sprite icon icon_1"></span>
                    <div class="info">
                        <p class="name">二维码</p>
                        <p class="team">让他人通过扫描二维码加入项目</p>
                    </div>
                </a>
            </li>
            <li class="mod-user com-border-bottom">
                <a @click="wxShare">
                    <span class="bg_sprite icon icon_2"></span>
                    <div class="info">
                        <p class="name">微信邀请</p>
                        <p class="team">让微信朋友通过链接加入项目</p>
                    </div>
                </a>
            </li>
        </ul>
        <ul class="user-list section">
            <li class="mod-user com-border-bottom">
                <a @click="toAddMember">
                    <span class="bg_sprite icon icon_3"></span>
                    <div class="info">
                        <p class="name">手动添加</p>
                        <p class="team">手动录入加入人员信息</p>
                    </div>
                </a>
            </li>
            <li class="mod-user com-border-bottom">
                <a @click="toTeamList">
                    <span class="bg_sprite icon icon_4"></span>
                    <div class="info">
                        <p class="name">团队成员</p>
                        <p class="team">从团队成员中添加</p>
                    </div>
                </a>
            </li>
            <li class="mod-user com-border-bottom">
                <a v-bind:href="contactPath">
                    <span class="bg_sprite icon icon_5"></span>
                    <div class="info">
                        <p class="name">通讯录</p>
                        <p class="team">从手机通讯录添加成员</p>
                    </div>
                </a>
            </li>
        </ul>
    </div> --> 
    <div class="page add-member" :class="{'show-navbar': notAddAdmins}">        
        <ul class="mod-tabs" v-if="notAddAdmins">
            <li><a :class="{'current':isActive1}" href="javascript:;" @click="addMemberTab">添加员工</a></li>
            <li><a :class="{'current':isActive2}" href="javascript:;" @click="addManagerTab">添加管理员</a></li>
        </ul>
        <div v-if="tab1_show">
            <!-- <div class="weui-cells__title">员工加入项目后在微信中即可签到、考勤</div> -->
            <div class="invite-wrap bg-color com-border-top">
                <div class="top">
                    <p>邀请员工加入到</p>
                    <h2>{{groupName | strEllipsis}}<span class="bg_sprite icon_edit" v-if="iconShow" @click="changeGroup"></span></h2>
                </div>
                <ul class="invite-list">
                    <li>
                        <a href="javascript:;" class="touch" @click="wxShareAndCopyLink(1,'')">
                            <span class="bg_sprite icon_ftf"></span>
                            <h3>微信邀请</h3>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:;" class="touch" @click="toQrCode('')">
                            <span class="bg_sprite icon_wx"></span>
                            <h3>面对面邀请</h3>
                        </a>
                    </li>
                   <!--  <li>
                        <a href="javascript:;" class="touch" @click="wxShareAndCopyLink(2)">
                            <span class="bg_sprite icon_link"></span>
                            <h3>复制邀请链接</h3>
                        </a>
                    </li> -->
                </ul> 
                <template v-if="can_set_required_info">
                    <div class="set-info com-border-top" v-if="!member_info_need_str" @click="gotoXmAddMemberInfo"><a href="javascript:;">设置员工填写信息</a></div>
                    <div class="set-info com-border-top" v-else>
                        <span class="selected">{{member_info_need_str}}</span>
                        <a href="javascript:;" @click="gotoXmAddMemberInfo">修改</a>
                    </div>
                </template>
                
            </div>
            <!-- <div class="weui-cells__title">常见问题</div>
            <div class="weui-cells">
                <a class="weui-cell weui-cell_access" :href="linkstr1">
                    <div class="weui-cell__bd">
                        <p>如何解决员工无法关注微信公众号的问题？</p>
                    </div>
                    <div class="weui-cell__ft">
                    </div>
                </a>
                <a class="weui-cell weui-cell_access" :href="linkstr2">
                    <div class="weui-cell__bd">
                        <p>员工关注微信公众号后如何开始工作？</p>
                    </div>
                    <div class="weui-cell__ft">
                    </div>
                </a>
            </div> -->
        </div>
        
        <div v-if="tab2_show && notAddAdmins">
            <!-- <div class="weui-cells__title">管理员加入项目后需要下载APP管理项目</div> -->
            <div class="invite-wrap bg-color com-border-top">
                  <div class="top">
                      <p>邀请管理员加入到</p> 
                      <h2>{{groupName2 | strEllipsis}}<span class="bg_sprite icon_edit" v-if="iconShow" @click="changeGroup"></span></h2>
                  </div>
                  <ul class="invite-list">
                      <li>
                          <a href="javascript:;" class="touch" @click="adminWxShareAndCopyLink(1,1)">
                              <span class="bg_sprite icon_ftf"></span>
                              <h3>微信邀请</h3>
                          </a>
                      </li>
                      <li>
                          <a href="javascript:;" class="touch" @click="toQrCode(1)">
                              <span class="bg_sprite icon_wx"></span>
                              <h3>面对面邀请</h3>
                          </a>
                      </li>
                      <li>
                          <a href="javascript:;" class="touch" @click="toAddMember">
                              <span class="bg_sprite icon_msg"></span>
                              <h3>短信邀请</h3>
                          </a>
                      </li>
                  </ul>
              </div>
              <!-- <div class="weui-cells__title">常见问题</div>
              <div class="weui-cells">
                  <a class="weui-cell weui-cell_access" :href="linkstr3">
                      <div class="weui-cell__bd">
                          <p>邀请管理员和邀请员工有什么不同？</p>
                      </div>
                      <div class="weui-cell__ft">
                      </div>
                  </a>
                  <a class="weui-cell weui-cell_access" :href="linkstr4">
                      <div class="weui-cell__bd">
                          <p>如何邀请管理员来一起帮我管理项目？</p>
                      </div>
                      <div class="weui-cell__ft">
                      </div>
                  </a>
              </div> -->
        </div>
    </div>
   <!--  <div class="page add-member" v-else>        
        <div class="invite-wrap bg-color com-border-top">
            <div class="top">
                <p>邀请员工加入到</p>
                <h2>{{groupName | strEllipsis}}<span class="bg_sprite icon_edit" v-if="iconShow" @click="changeGroup"></span></h2>
            </div>
            <ul class="invite-list">
                <li>
                    <a href="javascript:;" class="touch" @click="wxShareAndCopyLink(1)">
                        <span class="bg_sprite icon_ftf"></span>
                        <h3>微信邀请</h3>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" class="touch" @click="toQrCode('')">
                        <span class="bg_sprite icon_wx"></span>
                        <h3>面对面邀请</h3>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" class="touch" @click="wxShareAndCopyLink(2)">
                        <span class="bg_sprite icon_link"></span>
                        <h3>复制邀请链接</h3>
                    </a>
                </li>
            </ul>
        </div>
        <div class="weui-cells__title">常见问题</div>
        <div class="weui-cells">
            <a class="weui-cell weui-cell_access" :href="linkstr1">
                <div class="weui-cell__bd">
                    <p>如何解决员工无法关注微信公众号的问题？</p>
                </div>
                <div class="weui-cell__ft">
                </div>
            </a>
            <a class="weui-cell weui-cell_access" :href="linkstr2">
                <div class="weui-cell__bd">
                    <p>员工关注微信公众号后如何开始工作？</p>
                </div>
                <div class="weui-cell__ft">
                </div>
            </a>
        </div>
    </div> -->
</template>

<script>
    /**
     *  引入工具类库 或 Native API
     *  example : import widget from 'gapi/widget'
     */
     import socialApi from 'clientApi/socialApi'
     import * as util from 'js/util.js'
     import cache from 'gapi/cache'
    import commonPage from 'clientApi/commonPage.js'
    import widget from 'gapi/widget'
    import KCApiApp from 'clientApi/KCApiApp.js'


    /**
     *  引入组件 以及 组件接口(Action)
     *  example : import Somecomponents from 'components/Somecomponents/Somecomponents'
     */

    /**
     *  组件实例对象
     */
    export default {
        components: {

        },
        filters : {
            strEllipsis : function(str) {
                if (str.length > 10) {
                    return str.substring(0, 10) + '...'
                } else {
                    return str;
                }
            }
        },
        data: function(){
            return{
                notAddAdmins:false,//是否有权添加管理员
                tab1_show:true,
                tab2_show:false,
                isActive1:true,
                isActive2:false,
                isShowTitle: false,
                iconShow:false,
                inviteLink: "",
                sendGroupName:'',
                groupName:'',
                groupName2:'',
                member_info_need: [
                  // {
                  //   "id": 1,
                  //   "field": "age",
                  //   "name": "年龄",
                  //   "selected": 1
                  // },
                  // {
                  //   "id": 2,
                  //   "field": "gender",
                  //   "name": "性别",
                  //   "selected": 0
                  // },
                  // {
                  //   "id": 3,
                  //   "field": "height",
                  //   "name": "身高",
                  //   "selected": 1
                  // },
                  // {
                  //   "id": 4,
                  //   "field": "weight",
                  //   "name": "体重",
                  //   "selected": 1
                  // }
                ],
                can_set_required_info: false,//是否有权设置添加人员填写信息
            }
        },
        computed:{
            linkstr1(){
              return `dmsaas://browser/${encodeURIComponent('https://doumi.kf5.com/hc/kb/article/1012238/')}`
            },
            linkstr2(){
              return `dmsaas://browser/${encodeURIComponent('https://doumi.kf5.com/hc/kb/article/1012565/')}`
            },
            linkstr3(){
              return `dmsaas://browser/${encodeURIComponent('https://doumi.kf5.com/hc/kb/article/1012568/')}`
            },
            linkstr4(){
              return `dmsaas://browser/${encodeURIComponent('https://doumi.kf5.com/hc/kb/article/1012567/')}`
            },
            member_info_need_str(){
              // return this.member_info_need.join('、')
              let tempArr = []
              this.member_info_need.forEach((obj) => {
                if(obj.selected == 1){
                  obj.name = obj.name == "出生年月" ? '年龄' : obj.name
                  tempArr.push(obj.name)
                }
              })
              
              
              return tempArr.length ? tempArr.join('、') : ''
            }
        },
        vuex: {
            getters: {

            },
            actions: {

            }
        },
        methods: {
            /**
             * 初始化
             * @method init
             * @public
             * @return {Null} void
             */
            init (){
              // Native会自己调一次loadData，所以H5就不用调了
              // window.goBackAction = () => {
              //     commonPage.goBack(1)
              // }  ;
              // commonPage.updateTitleBar({
              //     backAction: 'goBackAction',
              //     leftAction : 'goBackAction'
              // });
              // commonPage.getWebViewID((data)=>{
              //   console.log(data)
              //   cache.setMemoryCache('xmAddMemberWebViewId',{'webViewID':data})
              // })
              // alert(location.href)
              if(util.getUrddataString('type')){
                this.projectId = util.getUrddataString('pId')
                this.teamId = util.getUrddataString('tId')
                this.groupId = util.getUrddataString('gId')
                this.userId = util.getUrddataString('uId')
                this.type = util.getUrddataString('type')
                this.groupName = util.getUrddataString('groupName')
                this.groupName2 = util.getUrddataString('groupName')
              }else{
                this.projectId = util.getQueryString('pId')
                this.teamId = util.getQueryString('tId')
                this.groupId = util.getQueryString('gId')
                this.userId = util.getQueryString('uId')
                this.groupName = decodeURIComponent(util.getQueryString('groupName'))
                this.groupName2 = decodeURIComponent(util.getQueryString('groupName'))
              }
              // alert(this.groupName)
              cache.setMemoryCache('KqCacheMessge',{
                  team_id: this.teamId,
                  project_id: this.projectId
              })
              this.contactPath = `dmsaas://ProjectContact?teamId=${this.teamId}&projectId=${this.projectId}&groupId=${this.groupId}&userId=${this.userId}`

              this.sendGroupName = this.groupName
              
              window.loadData = (data) => {
                console.log(data)
                  if(data.key !== undefined){
                    let key = data.key
                    let value = data.value
                    if(key == "selectGroup"){
                      if(this.isActive1 == true){
                        this.groupId = value.id
                        this.groupName = value.name
                        this.sendGroupName = value.name
                      }else{
                        this.groupId = value.id
                        this.groupName2 = value.name
                        this.sendGroupName = value.name
                      }
                    }else if(key == 'member_info_need'){
                      //请求接口修改设置
                      // console.log(data.member_info_need)
                      
                      //设置时只要id  遍历取出id
                      let tempArr = []
                      data.member_info_need.forEach((obj) => {
                        if(obj.selected == 1){
                          tempArr.push(obj.id)
                        }
                      })
                      console.log(tempArr)
                      commonPage.loadPageStatus('loading')
                      util.ajax({
                          url: '/group/required_info_field/set',
                          type: 'GET',
                          data: {
                              team_id: this.teamId,
                              project_id: this.projectId,
                              required_user_info: tempArr
                          },
                          timeout: 10000,
                          success: (result) => {
                              // success
                              // alert(JSON.stringify(result))
                              // console.log(result)
                              commonPage.loadPageStatus('loadSuccess')
                              if(result.errno == 0){
                                this.member_info_need = data.member_info_need
                              }else{
                                  widget.toast(result.errmsg)
                              }
                          },
                          error: (xhr, status) => {
                              commonPage.loadPageStatus('loadSuccess')
                              widget.toast('服务器异常')
                              // error
                          },
                          noNetwork: () => {
                              // 无网络的回调
                              commonPage.loadPageStatus('loadSuccess')
                              widget.toast('网络连接失败，请检查网络')
                          }
                      })
                      
                    }
                  }
              }
              // window.loadData = (data) => {
              //     console.log(data)
              //     if(!data)return
              //     if (data.back == 1) {
              //         commonPage.goBack(1)
              //     }
              //     if(data.key == 'member_info_need'){
              //       this.member_info_need = data.member_info_need
              //     }
              // }

              
            },
            //选择上级小组
            changeGroup (){
              commonPage.getWebViewID((data)=>{
                  cache.setMemoryCache('webViewID',{'webViewID':data})
              })
              location.href = "dmsaas://GroupSelectSingle"
            },
             // 添加成员切换
            addMemberTab (){
              //埋点
              let statisticsLog_data = {
                  event_id: '添加成员页-添加普通成员',
                  // event_label: data.event_label,(预留，现在不用传此参数)
                  event_param: {
                      ca_from: 'addstaff',
                      project_id: this.projectId,
                  }
              }
              // alert(JSON.stringify(statisticsLog_data))
              KCApiApp.statisticsLog(statisticsLog_data)

              this.isActive1 = true;
              this.isActive2 = false;
              this.tab1_show = true;
              this.tab2_show = false
            },
            //添加管理者切换
            addManagerTab (){
              //埋点
              let statisticsLog_data = {
                  event_id: '添加成员页-添加管理员',
                  // event_label: data.event_label,(预留，现在不用传此参数)
                  event_param: {
                      ca_from: 'addadmin',
                      project_id: this.projectId,
                  }
              }
              // alert(JSON.stringify(statisticsLog_data))
              KCApiApp.statisticsLog(statisticsLog_data)

              this.isActive1 = false
              this.isActive2 = true
              this.tab1_show = false
              this.tab2_show = true
            },
            //二维码
            toQrCode (code){
              if(code == 1){
                //埋点
                let statisticsLog_data = {
                    event_id: '添加成员页-面对面邀请',
                    // event_label: data.event_label,(预留，现在不用传此参数)
                    event_param: {
                        ca_from: 'facetoface',
                        project_id: this.projectId,
                        from: 'addadmin',
                    }
                }
                // alert(JSON.stringify(statisticsLog_data))
                KCApiApp.statisticsLog(statisticsLog_data)
              }else{
                //埋点
                let statisticsLog_data = {
                    event_id: '添加成员页-面对面邀请',
                    // event_label: data.event_label,(预留，现在不用传此参数)
                    event_param: {
                        ca_from: 'facetoface',
                        project_id: this.projectId,
                        from: 'addstaff',
                    }
                }
                // alert(JSON.stringify(statisticsLog_data))
                KCApiApp.statisticsLog(statisticsLog_data)
              }
              window.location.href="dmsaas://ProjectQrCode?urdData="+encodeURIComponent(`tId=${this.teamId}&pId=${this.projectId}&gId=${this.groupId}&code=${code}`)
              // let data = {
              //   tId:this.teamId,
              //   pId:this.projectId,
              //   gId:this.groupId
              // }
              // console.log(data) 
              // socialApi.faceToFaceShare(data)
            },
            //管理员微信邀请和复制链接
            adminWxShareAndCopyLink(type,code){
              util.ajax({//获取邀请链接
                    url:'/group/wechat',
                    type:'GET',
                    data:{
                        group_id: this.groupId,
                        team_id: this.teamId,
                        project_id : this.projectId,
                        type:1
                    },
                    timeout:10000,
                    beforeSend: () => {

                    },
                    success:(result) => {
                        // console.log(result)
                        if(result.errno == 0){
                            //埋点
                            let statisticsLog_data = {
                                event_id: '添加成员页-微信邀请',
                                // event_label: data.event_label,(预留，现在不用传此参数)
                                event_param: {
                                    ca_from: 'wechat',
                                    project_id: this.projectId,
                                    from: 'addadmin',
                                }
                            }
                            // alert(JSON.stringify(statisticsLog_data))
                            KCApiApp.statisticsLog(statisticsLog_data)

                            let rData = result.data;
                            this.inviteLink = rData.url
                            let data = {
                                title: rData.title,
                                text: rData.text,
                                logo: rData.logo == '' ? 'http://sta.doumistatic.com/src/image/saas/avatar.png' : rData.logo,
                                url: this.inviteLink,
                                type: type,
                                tId: this.teamId,
                                pId: this.projectId,
                                gId: this.groupId,
                                viewType: 1,
                                code: code,
                                groupName: this.groupName
                            }
                            console.log(data)
                            socialApi.weiXinShare(data)
                        }
                    },
                    error: (xhr, status) => {
                        // error
                        console.log(xhr)
                    },
                    complete: () => {

                    },
                    noNetwork: () => {
                        // 无网络的回调
                        widget.toast('网络连接失败，请检查网络')
                    }
                })
            },
            //成员微信邀请和复制链接
            wxShareAndCopyLink(type,code){
              util.ajax({//获取邀请链接
                    url:'/group/wechat',
                    type:'GET',
                    data:{
                        group_id: this.groupId,
                        team_id: this.teamId,
                        project_id : this.projectId,
                        type:''
                    },
                    timeout:10000,
                    beforeSend: () => {

                    },
                    success:(result) => {
                        // console.log(result)
                        if(result.errno == 0){

                            if(type == 1){
                              //埋点
                              let statisticsLog_data = {
                                  event_id: '添加成员页-微信邀请',
                                  // event_label: data.event_label,(预留，现在不用传此参数)
                                  event_param: {
                                      ca_from: 'wechat',
                                      project_id: this.projectId,
                                      from: 'addstaff',
                                  }
                              }
                              // alert(JSON.stringify(statisticsLog_data))
                              KCApiApp.statisticsLog(statisticsLog_data)
                            }else{
                              //埋点
                              let statisticsLog_data = {
                                  event_id: '添加成员页-复制邀请链接',
                                  // event_label: data.event_label,(预留，现在不用传此参数)
                                  event_param: {
                                      ca_from: 'copyurl',
                                      project_id: this.projectId,
                                      from: 'addstaff',
                                  }
                              }
                              // alert(JSON.stringify(statisticsLog_data))
                              KCApiApp.statisticsLog(statisticsLog_data)
                            }

                            let rData = result.data;
                            this.inviteLink = rData.url
                            let data = {
                                title: rData.title,
                                text: rData.text,
                                logo: rData.logo == '' ? 'http://sta.doumistatic.com/src/image/saas/avatar.png' : rData.logo,
                                url: this.inviteLink,
                                type: type,
                                tId: this.teamId,
                                pId: this.projectId,
                                gId: this.groupId,
                                viewType: 1,
                                code: code,
                                groupName: this.groupName
                            }
                            console.log(data)
                            socialApi.weiXinShare(data)
                        }
                    },
                    error: (xhr, status) => {
                        // error
                        console.log(xhr)
                    },
                    complete: () => {

                    },
                    noNetwork: () => {
                        // 无网络的回调
                        widget.toast('网络连接失败，请检查网络')
                    }
                })
            },
            //手动添加该小组人员
            toAddMember() {
              //埋点
              let statisticsLog_data = {
                  event_id: '添加成员页-短信邀请',
                  // event_label: data.event_label,(预留，现在不用传此参数)
                  event_param: {
                      ca_from: 'sms',
                      project_id: this.projectId,
                      from: 'addadmin',
                  }
              }
              // alert(JSON.stringify(statisticsLog_data))
              KCApiApp.statisticsLog(statisticsLog_data)

            cache.setMemoryCache('KqCacheMessge', {
                project_id: this.projectId,
                team_id: this.teamId
            })
              let encodeUrl = `gId=${this.groupId}&tId=${this.teamId}&pId=${this.projectId}&uId=${this.userId}&gName=${this.sendGroupName}&type=${this.type}`
              // console.log(this.groupId)
              window.location.href="dmsaas://ProjectManuallyAdd?urdData="+encodeURIComponent(encodeUrl)
            },
            toTeamList(){
              let encodeUrl = `gId=${this.groupId}&tId=${this.teamId}&pId=${this.projectId}&uId=${this.userId}`
              window.location.href="dmsaas://ProjectTeamList?urdData="+encodeURIComponent(encodeUrl)
            },
            gotoXmAddMemberInfo(){
              let tempArr = JSON.stringify(this.member_info_need)
              let encodeStr = encodeURIComponent(`member_info_need=${tempArr}&team_id=${this.teamId}&project_id=${this.projectId}`)
              location.href = `dmsaas://XmAddMemberInfo?urdData=${encodeStr}`
            },
            getRequiredInfo(){
                //获取可以设置的必填项信息(信息包括是否已选中)
                // console.log(this.teamId)
                // console.log(this.projectId)
                commonPage.loadPageStatus('loading')
                util.ajax({
                    url: '/group/extra_info_field',
                    type: 'GET',
                    data: {
                        team_id: this.teamId,
                        project_id: this.projectId
                    },
                    timeout: 10000,
                    success: (data) => {
                        // success
                        // alert(JSON.stringify(data))
                        console.log(data)
                        commonPage.loadPageStatus('loadSuccess')
                        if(data.errno == 0){
                          this.member_info_need = data.data
                        }else{
                            widget.toast(data.errmsg)
                            // alert(JSON.stringify(data))
                        }
                    },
                    error: (xhr, status) => {
                        commonPage.loadPageStatus('loadSuccess')
                        widget.toast('服务器异常')
                        // error
                    },
                    noNetwork: () => {
                        // 无网络的回调
                        commonPage.loadPageStatus('loadSuccess')
                        widget.toast('网络连接失败，请检查网络')
                    }
                })
            }
        },
        created(){
            cache.getCache('projectAllMemberData', (data) => {
                
                if(data){
                  if(data.children && data.children.length){
                    this.iconShow = true
                  }
                }else{
                  util.ajax({
                      url:'/group/member_list',
                      type:'GET',
                      data:{
                          team_id : this.teamId,
                          project_id : this.projectId,
                      },
                      timeout:10000,
                      success:(result) => {
                        // console.log(result)
                        if (result.errno == 0){
                          if(result.data[0].children && result.data[0].children.length){
                            this.iconShow = true
                          }
                          cache.setCache('projectAllMemberData', result.data[0], 86400)
                        }else{
                          widget.toast(result.errmsg)
                        }
                      },
                      error: (xhr, status) => {
                        // error
                        widget.toast('服务器异常')
                      },
                      noNetwork: () => {
                        // 无网络的回调
                        widget.toast('网络连接失败，请检查网络')
                      } 
                  })
                }
            })
            this.init();

            
        },
        ready (){
          // 权限获取--是否有权先添加管理员
          //是否有权限设置邀请人员填写信息
          util.ajax({
            url:'/permission/application',
            type:'GET',
            data:{
                team_id:this.teamId,
                project_id:this.projectId,
                application_id:0
            },
            timeout:10000,
            success:(obj) => {
                // console.log(obj)
                if(obj&&obj.errno == 0){
                  console.log(JSON.stringify(obj.data))
                    obj.data.forEach( (item) => {
                        if(item.id_name == 'wechat_add_project_leader'){
                            this.notAddAdmins = true
                        }
                        if(item.id_name == 'set_required_info'){
                            this.can_set_required_info = true
                            console.log('设置邀请填写项的权限')
                            //请求默认设置
                            this.getRequiredInfo()
                        }
                    })
                }else{
                    widget.toast(obj.errmsg)
                }
            },
            error: (xhr, status) => {
                widget.toast('服务器异常')
            },
            noNetwork: () => {
                widget.toast('网络连接失败，请检查网络')
            }
          })
        }

    }


</script>

<!-- CSS 样式 -->
<style src="../../node_modules/weui/dist/style/weui.css"></style>
<style src="../../static/css/common.css"></style>
<style src="../../static/css/project.css"></style>
